<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head lang="en">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"/>
    <meta name="format-detection" content="telephone=no"/>
    <meta name="format-detection" content="email=no"/>
    <meta charset="UTF-8">
    <script type="text/javascript" th:src="@{${session.baseUrl}+'js/common.js'}"></script>
    <script th:src="@{${session.baseUrl}+'js/jquery.js'}"></script>
    <link rel="stylesheet" th:href="@{${session.baseUrl}+'style/index.css'}"/>
    <link th:href="@{${session.baseUrl}+'style/reset.css'}" rel="stylesheet" type="text/css">
    <link th:href="@{${session.baseUrl}+'style/base.css'}" rel="stylesheet" type="text/css">
    <link th:href="@{${session.baseUrl}+'style/header.css'}" rel="stylesheet" type="text/css">
    <link rel="stylesheet" th:href="@{${session.baseUrl}+'style/myProject.css'}"/>
    <title>我的项目</title>
    <style>
        #content0 li img{
            width: 2.65rem;
            height: 1.8rem;
            display: block;
            border: none;
            float: left;
        }
        ul{
            display: block;
            list-style: none;
            margin-block-start: 1em;
            margin-block-end: 1em;
            margin-inline-start: 0px;
            margin-inline-end: 0px;
            background-color: white;



        }
        ul a{
            text-decoration:none;
        }
        ul a:visited{
            color: #323232;
        }
        ul a:link{
            color: #323232;
        }
        ul li{
            text-align: -webkit-match-parent;
            display: flex;
            padding: 0.16rem 0.3rem 0.18rem 0.3rem;
            border-bottom: 0.1rem solid #f2f2f2;
            margin: 0;
        }

    </style>
</head>
<body>
<header><span onclick="javascript:history.go(-1)"></span>我的项目</header>
<div th:if="${subList==null || subList.size()==0}">
    <img th:src="@{${session.baseUrl}+'\images\zanwu.png'}"
         style="width: 8.5rem;height:5.2rem;transform: translate(0rem, 0rem);"/>
</div>
<!--<ul id="content0" class="content" th:if="${subList!=null}">
     <span th:unless="${#lists.isEmpty(subList)}">
        <li th:each="mp,iterStat:${subList}">
            <a th:href="@{/wap/trafts.html/(memberProjectId=${mp.id})}">
            <div class="container">
                <i th:if="${mp.type==0}"><img th:src="@{${session.baseUrl}+'images/projectDetail/mingxing.png'}" alt=""
                                              style="width: 100%;height: 3.8rem;"/></i>
                <i th:if="${mp.type==1}"><img th:src="@{${session.baseUrl}+'images/projectDetail/youxiu.png'}" alt=""
                                              style="width: 100%;height: 3.8rem;"/></i>
                <i th:if="${mp.type==2}"><img th:src="@{${session.baseUrl}+'images/projectDetail/xingjiabi.png'}" alt=""
                                              style="width: 100%;height: 3.8rem;"/></i>
                <p class="intro" th:text="${mp.projectName}"></p>
            </div>
            <div class="message">
                <div>
                    <div class="f22 g9">认购金额：<span class="f26 money" th:text="${mp.money}"></span></div>
                </div>
                <div>
                    <div class="f22 g9">收益金额：<span class="f26 money" th:text="${mp.earningsMoney}"></span></div>
                </div>
                <div>
                    <p class="day" th:text="'收益期限：'+${mp.dayNum}+'天'"></p>
                </div>
            </div>
            </a>
        </li>
     </span>
</ul>-->

<ul id="content0"  th:if="${subList!=null}">
<i th:each="mp,iterStat:${subList}">
    <a th:href="@{/wap/trafts.html/(memberProjectId=${mp.id})}">

        <li >

            <i th:if="${mp.type==0}"><img th:src="@{${session.baseUrl}+'images/projectDetail/mingxing.png'}" alt=""
                                          /></i>
            <i th:if="${mp.type==1}"><img th:src="@{${session.baseUrl}+'images/projectDetail/youxiu.png'}" alt=""
                                          /></i>
            <i th:if="${mp.type==2}"><img th:src="@{${session.baseUrl}+'images/projectDetail/xingjiabi.png'}" alt=""
                                          /></i>
            <div style="width: 4.5rem;height: 2rem;">
                <div style="width: 3rem;height: 0.5rem;margin-left: 0.2rem">
                    <span th:text="${mp.projectName}"
                          style="font-size:0.25rem;color: black; width: 3.2rem;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"></span>
                </div>

                <div th:if="${mp.status}==3" style="width: 1rem;height: 0.5rem;margin-left: 3rem;margin-top: -0.45rem">
                    <span style="border: 1px solid black;color: black;font-size: 0.2rem;border-radius: 20px;font-weight:bold;width: 0.8rem;padding: 0.1rem 0.1rem">转让中</span>
                </div>
                <div th:if="${mp.status}==5" style="width: 1rem;height: 0.5rem;margin-left: 3rem;margin-top: -0.45rem">
                    <span style="border: 1px solid black;color: black;font-size: 0.2rem;border-radius: 20px;font-weight:bold;width: 0.8rem;padding: 0.1rem 0.1rem">已结束</span>
                </div>
                <div th:if="${mp.status}==2" style="width: 1rem;height: 0.5rem;margin-left: 3rem;margin-top: -0.45rem">
                    <span style="border: 1px solid black;color: black;font-size: 0.2rem;border-radius: 20px;font-weight:bold;width: 0.8rem;padding: 0.1rem 0.1rem">已转让</span>
                </div>
                <div th:if="${mp.status}==1" style="width: 1rem;height: 0.5rem;margin-left: 3rem;margin-top: -0.45rem">
                    <span style="border: 1px solid black;color: black;font-size: 0.2rem;border-radius: 20px;font-weight:bold;width: 0.8rem;padding: 0.1rem 0.1rem">进行中</span>
                </div>

                <div style="width: 4.2rem;height: 1.5rem;margin-left: 0.1rem">
                    <div style="width: 1.4rem;height: 1.5rem;float: left;">
                        <p style="font-size: 0.3rem;padding-top: 0.3rem" align="center"
                           th:text="'¥'+${mp.money}"></p>
                        <p style="color:#707070;font-size: 0.2rem;padding-top: 0.3rem" align="center">认购金额</p>
                    </div>


                    <div style="width: 1.4rem;height: 1.5rem;float: left" >
                        <p style="font-size: 0.3rem;padding-top: 0.3rem;color: red;font-weight: bolder" align="center"
                           th:text="${#numbers.formatDecimal(mp.earningsMoney,1,2)}"></p>
                        <p style="color:#707070;font-size: 0.2rem;padding-top: 0.3rem" align="center">收益金额</p>
                    </div>
                    <div style="width: 1.4rem;height: 1.5rem;float: left" >
                        <p style="font-size: 0.3rem;padding-top: 0.3rem" align="center" th:text="${mp.dayNum}+'天'"></p>
                        <p style="color:#707070;font-size: 0.2rem;padding-top: 0.3rem" align="center">收益期限</p>
                    </div>
                </div>

            </div>

    </li>
    </a>
</i>
</ul>


<script type="text/javascript" th:inline="javascript">
    var basePath = /*[[${#httpServletRequest.getScheme() + "://" + #httpServletRequest.getServerName() + ":" + #httpServletRequest.getServerPort() + #httpServletRequest.getContextPath()}]]*/;

    var num = 1;
    $(function () {
        $(window).scroll(
            function () {

                if ((document.documentElement.scrollHeight) == (document.documentElement.scrollTop | document.body.scrollTop) + document.documentElement.clientHeight) {
                    num = num + 1;

                    $.ajax({
                        type: "POST",
                        data: {
                            current: num,
                            memberId:/*[[${session.memberId}]]*/,
                        },
                        url: basePath + '/wap/memberProject/pageList',
                        cache: false,
                        /*async:true,    //true：异步，false：同步。*/
                        success: function (data) {

                            str = '';
                            $.each(data, function (index, value) {
                                str += '<i>';
                                str += '<a href="/wap/trafts.html?memberProjectId=' + value.id + '">';
                                str += '<li>';
                                if (value.type == 0) {
                                    str += '<img src="http://www.zcjjr.com:8050/crowd-wap/images/projectDetail/mingxing.png" alt="" class="banner"/>';
                                } else if (value.type == 1) {
                                    str += '<img src="http://www.zcjjr.com:8050/crowd-wap/images/projectDetail/youxiu.png" alt="" class="banner"/>';
                                } else {
                                    str += '<img src="http://www.zcjjr.com:8050/crowd-wap/images/projectDetail/xingjiabi.png" alt="" class="banner"/>';
                                }
                                str +='<div style="width: 4.5rem;height: 2rem;">';
                                str +='<div style="width: 3rem;height: 0.5rem;float: left;margin-left: 0.2rem">';
                                str +='<span style="font-size:0.25rem;color: black; width: 3.2rem;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">' + value.projectName + '</span></div>';
                                if(value.status == 3){
                                   str +='<span style="border: 1px solid black;color: black;font-size: 0.2rem;border-radius: 20px;font-weight:bold;width: 0.8rem;padding: 0.1rem 0.1rem">转让中</span>';
                                }else if(value.status == 5){
                                    str +='<span style="border: 1px solid black;color: black;font-size: 0.2rem;border-radius: 20px;font-weight:bold;width: 0.8rem;padding: 0.1rem 0.1rem">已结束</span>';
                                }else if(value.status == 2){
                                    str +='<span style="border: 1px solid black;color: black;font-size: 0.2rem;border-radius: 20px;font-weight:bold;width: 0.8rem;padding: 0.1rem 0.1rem">已转让</span>';
                                }else if(value.status == 1){
                                    str +='<span style="border: 1px solid black;color: black;font-size: 0.2rem;border-radius: 20px;font-weight:bold;width: 0.8rem;padding: 0.1rem 0.1rem">进行中</span>';
                                }
                                str +='<div style="width: 4.2rem;height: 1.5rem;margin-left: 0.1rem"><div style="width: 1.4rem;height: 1.5rem;float: left;">';
                                str +='<p style="font-size: 0.3rem;padding-top: 0.3rem" align="center">' + value.money.toFixed(2) + '</p><p style="color:#707070;font-size: 0.2rem;padding-top: 0.3rem" align="center">认购金额</p></div><div style="width: 1.4rem;height: 1.5rem;float: left" >';
                                str +='<p style="font-size: 0.3rem;padding-top: 0.3rem;color: red;font-weight: bolder" align="center" >' + value.earningsMoney.toFixed(2) + '</p><p style="color:#707070;font-size: 0.2rem;padding-top: 0.3rem" align="center">收益金额</p></div><div style="width: 1.4rem;height: 1.5rem;float: left">';
                                str +='<p style="font-size: 0.3rem;padding-top: 0.3rem" align="center">' + value.dayNum + '天</p><p style="color:#707070;font-size: 0.2rem;padding-top: 0.3rem" align="center">收益期限</p></div></div></div></li></a></i>';

                            });
                            $("#content0").append(str); //动态加载插入HTML
                        },
                        error: function () {
                            alert("ajax请求失败");
                        }
                    })


                }
            });
    });


</script>
</body>
</html>